﻿namespace MicroCloud.Identity.Entities
{
    /// <summary>
    /// 实体类：用户详细信息
    /// </summary>
    [Description("用户详细信息")]
    [ValueGenerate(ValueGenerateRule.Never, ValueGenerateMode.Snowflake)]
    [Table(nameof(UserDetail), Schema = TableSchemaConstants.Identity)]
    public class UserDetail : EntityBase<long>
    {
        #region "属性"
        #region "获取或设置 用户编号"
        /// <summary>
        /// 获取或设置 用户编号
        /// </summary>
        [Column("UserId")]
        [DisplayName("用户编号")]
        public long UserId { get; set; }
        #endregion

        #region "获取或设置 注册IP"
        private string _RegisterIp = "";
        /// <summary>
        /// 获取或设置 注册IP
        /// </summary>
        [Column("RegisterIp")]
        [StringSize(StringSizeType.Code)]
        [DisplayName("注册IP")]
        public string RegisterIp { get { return _RegisterIp; } set { _RegisterIp = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 注册类型"
        /// <summary>
        /// 获取或设置 注册类型
        /// </summary>
        [Column("RegisterType")]
        [DisplayName("注册类型")]
        public UserRegisterType RegisterType { get; set; } = UserRegisterType.Neither;
        #endregion

        #region "获取或设置 性别"
        /// <summary>
        /// 获取或设置 性别
        /// </summary>
        [Column("Gender")]
        [DisplayName("性别")]
        public Gender Gender { get; set; }
        #endregion
        #region "获取或设置 生日"
        /// <summary>
        /// 获取或设置 生日
        /// </summary>
        [Column("Birthday")]
        [DisplayName("生日")]
        public DateTime? Birthday { get; set; }
        #endregion
        #region "获取或设置 血型"
        private string _BloodType = "";
        /// <summary>
        /// 获取或设置 血型
        /// </summary>
        [Column("BloodType")]
        [StringSize(StringSizeType.Key)]
        [DisplayName("血型")]
        public string BloodType { get { return _BloodType; } set { _BloodType = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 标签"
        private string _Tag = "";
        /// <summary>
        /// 获取或设置 标签
        /// </summary>
        [Column("Tag")]
        [StringSize(StringSizeType.Description)]
        [DisplayName("标签")]
        public string Tag { get { return _Tag; } set { _Tag = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 头衔"
        private string _Title = "";
        /// <summary>
        /// 获取或设置 头衔
        /// </summary>
        [Column("Title")]
        [StringSize(StringSizeType.Description)]
        [DisplayName("头衔")]
        public string Title { get { return _Title; } set { _Title = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 地址"
        private string _Address = "";
        /// <summary>
        /// 获取或设置 地址
        /// </summary>
        [Column("Address")]
        [StringSize(StringSizeType.General)]
        [DisplayName("地址")]
        public string Address { get { return _Address; } set { _Address = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 简介"
        private string _Profile = "";
        /// <summary>
        /// 获取或设置 简介
        /// </summary>
        [Column("Profile")]
        [StringSize(StringSizeType.Description)]
        [DisplayName("简介")]
        public string Profile { get { return _Profile; } set { _Profile = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 个性签名"
        private string _Sign = "";
        /// <summary>
        /// 获取或设置 个性签名
        /// </summary>
        [Column("Sign")]
        [StringMax]
        [DisplayName("个性签名")]
        public string Sign { get { return _Sign; } set { _Sign = value.ReplaceNull(); } }
        #endregion
        #region "获取或设置 备注"
        private string _Remark = "";
        /// <summary>
        /// 获取或设置 备注
        /// </summary>
        [Column("Remark")]
        [StringSize(StringSizeType.Remark)]
        [DisplayName("备注")]
        public string Remark { get { return _Remark; } set { _Remark = value.ReplaceNull(); } }
        #endregion

        #region "获取或设置 主页"
        private string _HomePath = "";
        /// <summary>
        /// 获取或设置 主页
        /// </summary>
        [Column("HomePath")]
        [StringSize(StringSizeType.Content)]
        [DisplayName("主页")]
        public string HomePath { get { return _HomePath; } set { _HomePath = value.ReplaceNull(); } }
        #endregion

        //导航属性
        #region "获取或设置 所属用户信息"
        /// <summary>
        /// 获取或设置 所属用户信息
        /// </summary>
        [JsonIgnore]
        public virtual User User { get; set; }
        #endregion

        #endregion

    }
}
